class Widget {
    constructor(templateString) {
        let template = "<div id='_" + Widget.getUniqueId() + "'>" + templateString + "<div>";

        let div = document.createElement('div');
        div.innerHTML = template;

        this.domNode = div.firstChild;
    }

    appendTo(element) {
        element.appendChild(this.domNode);
    }

    static getUniqueId() {
        this.count ++;
        return this.count;
    }
}

Widget.count = 0;

module.exports = Widget;
